/**
 * Created by IntelliJ IDEA.
 * User: Bezdelnick
 * Date: 10.05.13
 * Time: 16:49
 * To change this template use File | Settings | File Templates.
 */
package physics.core {
import flash.events.Event;
import mx.containers.Panel;
import mx.core.UIComponent;

public class VirtualPhysicsLabWork extends UIComponent {
    private var inputPanel:Panel;
    private var scene:UIComponent;
    private var playbackPanel:PlayBack;

    public function VirtualPhysicsLabWork() {
        if (stage) onAddedToSage();
        else this.addEventListener(Event.ADDED_TO_STAGE, onAddedToSage);
    }

    public function onAddedToSage(event:Event = null):void {
        inputPanel = new Panel();
        inputPanel.x = 10;
        inputPanel.y = 10;
        inputPanel.width = 180;
        inputPanel.height = 480;
        inputPanel.title = "Параметры";
        addChild(inputPanel);

        scene = new UIComponent();
        scene.x = 200;
        scene.y = 10;
        scene.width = 600;
        scene.height = 480;
        addChild(scene);

        playbackPanel = new PlayBack(this);
        playbackPanel.x = 200;
        playbackPanel.y = 500;
        addChild(playbackPanel);

        initLab(event);

        trace("VirtualPhysicsLabWork - onAddedToSage(event) - Added to stage");
    }

    public function initLab(event:Event = null):void {
        // TODO: Override me!!
    }

    public function startLab():void {
        stage.addEventListener(Event.ENTER_FRAME, updateLab);
    }

    public function updateLab(event:Event = null):void {
        // TODO: Override me!!
    }

    public function pauseLab():void {
        stage.removeEventListener(Event.ENTER_FRAME, updateLab);
    }

    public function resetLab():void {
        // TODO: Override me!!
    }

    public function inputData():void {
        //
    }

    public function outputData():void {
        //
    }
}
}
